local skynet = require "skynet"

local max_client = 64


skynet.start(function()
	print("Server start")
	local console = skynet.newservice("console")
	local protocol = skynet.newservice("protocol_service")
	print("real protocol address:", protocol)
	skynet.newservice("debug_console", 8000)
	local watchdog = skynet.newservice("watchdog", protocol)
 	local loginServer = skynet.newservice("login_service")
 	print("loginServer address:", loginServer)
 	local mongo_service = skynet.newservice("mongo_service")

	-- PlayerManager = skynet.newservice("player_manager", protocol)

	skynet.call(loginServer, "lua", "init", protocol, mongo_service)

	skynet.call(watchdog, "lua", "start", {
		port = 9999,
		maxclient = max_client,
		nodelay = true,
	})
	print("Watchdog listen on ", 9999)
	skynet.exit()
	print("Skynet exiting now...")
end)